package tv.acgn.advertisement.index.po;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * @program: advertisement-ad-publish-po
 * @description: 推广单元
 * @author: junG
 * @create: 2019-04-29 23:05
 **/

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ad_unit")
@Entity
@DynamicInsert
@DynamicUpdate
public class AdUnitPO {

    @Id
    @Column(name = "unit_id", nullable = true, unique = true, length = 64)
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    private String unitId;

    /**
     * 推广单元 相关的推广计划 关联推广计划表 {@link AdPlanPO} 的 planId
     *
     * @see AdPlanPO - planId
     */
    @Id
    @Column(name = "plan_id", nullable = true)
    private String planId;

    @Column(name = "unit_name", nullable = false)
    private String unitName;

    /**
     * 推广单元状态
     */
    @Column(name = "unit_status", nullable = false)
    private Integer unitStatus;

    /**
     * 广告位类型
     */
    @Column(name = "position_type", nullable = false)
    private Integer positionType;

    /**
     * 推广单元预算
     */
    @Column(name = "budget", nullable = false)
    private BigDecimal budget;

    @Column(name = "create_time", nullable = false)
    private LocalDateTime createTime;

    @Column(name = "update_time", nullable = false)
    private LocalDateTime updateTime;
}
